package com.hl;

import com.hl.entity.Teacher;
import com.hl.mapper.TeacherMapper;
import com.hl.util.MybatisUtils;
import org.apache.ibatis.session.SqlSession;

import java.io.IOException;
import java.util.List;
/**
 * 模糊查询测试
 * */
public class Test2Like {
    public static void main(String[] args) throws IOException {
        SqlSession sqlSession = MybatisUtils.getSqlSession();
        TeacherMapper mapper = sqlSession.getMapper(TeacherMapper.class);

        List<Teacher> list1 = mapper.selectTeacherLikeByName1("王");
        for (Teacher teacher : list1) {
            System.out.println(teacher);
        }

        List<Teacher> list2 = mapper.selectTeacherLikeByName2("张");
        for (Teacher teacher : list2) {
            System.out.println(teacher);
        }

        List<Teacher> list3 = mapper.selectTeacherLikeByName3("李");
        for (Teacher teacher : list3) {
            System.out.println(teacher);
        }
    }
}
